import request from '@/common/js/request.js';

export default {
	
	//微信小程序登录
	miniProgramLogin(data) {
		return request({
			url: '/auth/mini-program-login',
			method: 'POST',
			data
		});
	},
	
	//获取用户信息
	getUserInfo(data) {
		return request({
			url: '/user/info',
			method: 'POST',
			data
		});
	},
	
	

	// 后台插入数据
	insetData(data) {
		return request({
			url: '/users/auth',
			method: 'POST',
			data
		});
	},
	// 获取手机号，增加用户微信信息
	insetDatatwo(data) {
		return request({
			url: '/users/phone',
			method: 'POST',
			data
		});
	},

	
	
	// 获取openid
	loginByProvider(data){
		return request({
			url: '/users/getCodeTransferOpenid',
			method: 'POST',
			data
		});
	},
	
	// 用openid获取-获取用户信息，不用重复获取手机号
	openidUserInfo(data){
		return request({
			url: '/users/openidUserInfo',
			method: 'POST',
			data
		});
	},
	
	

	
	
	
	//退出系统
	logout(accessToken) {
		return request({
			url: '/auth/logout', // /auth/logout?accessToken=${accessToken}
			method: 'GET',
			data: { accessToken }
		});
	}

};